The phrase "a taste of one's own medicine" means to experience something unpleasant or difficult that you have previously inflicted on someone else. It is a way of saying that someone who has been cruel, harsh or unfair in their treatment of others will now receive the same kind of treatment themselves. The phrase suggests that justice has been served and that those who wronged others are getting what they deserve.